<?php

class MKT_Model_DbTable_Base extends Zend_Db_Table_Abstract {

    public function insertCustom($data, $delayed = true, $ignore = true) {
        $cols           = array_keys($data);
        $str_cols       = $this->getStrCols($cols);
        $delayed_string = ($delayed == true) ? "DELAYED" : "";
        $ignore_string  = ($ignore == true)  ? "IGNORE"  : "";
        
        $sql = "INSERT $delayed_string $ignore_string INTO {$this->_name} ($str_cols) VALUES ";
        $val = $this->getAdapter()->quoteInto("(?)", $data);
        $sql .= $val;
        $this->getAdapter()->query($sql);
    }

    private function getStrCols($cols) {
        $result = '';
        foreach ($cols as $col) {
            $result .= "`$col`,";
        }
        return rtrim($result, ',');
    }

}

?>
